The present invention relates to a data transmission control device and a storage device and, in particular, to timing control of command completion notification.
Devices using various types of media such as optical disks and magnetic tapes are known as information recording and reproducing devices. Among them, hard disk drives have become popular as storage devices for computers to such an extent that they are one of the storage devices indispensable for today's computers. Further, not limited to computers, their application is widening more and more due to the superior characteristics with the advent of moving picture recording/reproducing devices, car navigation systems, removable memories for digital cameras and so on.
Each magnetic disk used in hard disk drives has a plurality of tracks formed concentrically and each track is partitioned into a plurality of sectors. In each sector, sector address information and user data are stored. Either data write to a sector or data read from the sector is enabled by the head which accesses the desired sector according to the sector address information. A signal read out from a magnetic disk through data read operation is subjected to waveform shaping, decoding processing and other prescribed signal processing by a signal processing circuit before it is transmitted to the host. Likewise, data transferred from the host is subjected to prescribed signal processing by a signal processing circuit and then written to the magnetic disk.
For data transmission between a host and a hard disk drive, such an interface protocol as the SCSI interface or ATA interface is usually used. In particular, the ATA interface is used by many computers due to its improved interfacing capability and low cost. The ATA interface is also widely used by storage devices including other types of devices such as optical disk storage devices. As recording media have advanced in recording density, however, the demand for higher performance has occurred. There have been intensifying demands for the ATA interface to raise the data transfer rate. Accordingly, a serial transfer ATA interface is proposed to replace existing parallel transmission protocols.
Serial ATA specifications are being developed by the “Serial ATA Working Group.” In “Serial ATA II: Extensions to Serial ATA 1.0 Specification” which is already released, some techniques, not encompassed by the existing parallel ATA, are employed. One of them is a command queuing technique called NCQ (Native Command Queuing). NCQ allows a hard disk drive itself to internally determine an order in which the queued commands are to be executed. This makes it possible to effectively reduce latencies which are attributable to the mechanical internal operations of the hard disk drive.
One example featuring the NCQ technique concerns the issuance of command completion notifications. The status of each queued command is managed by the SActive register on the host. The status of a queued command can be changed from “outstanding” to “complete” by clearing the corresponding bit of the SActive register. Clearing bits of the SActive register is implemented by a data frame from the hard disk drive. This data frame is called a “Set Device Bits FIS.” Each command completion notification can be transmitted at any timing. For example, the hard disk drive can either successively transmit “Set Device Bits FIS” to the host for the corresponding plural commands or use a single “Set Device Bits FIS” which notifies the host that two commands have completed.
NCQ aside, an example of a technique concerning the control of command completion notification is disclosed in Japanese Patent Laid-Open No. 2001-312373. In this technique, the timing of issuing a command complete signal is controlled in order to prevent the data in the sector buffer from being overwritten by a newly accepted command. If a write command is newly accepted when there are outstanding write commands accepted earlier, the hit status indicating the positional relations with the LBAs for the outstanding commands is checked to rearrange the order in which data write to the recording medium is to be done, and then write data is recorded in the medium according to the rearranged order. At this time, if the free space in the sector buffer is not larger than a predefined size and the hit status is NOHIT, recording to the medium is started with priority for the newly accepted command without issuing a command complete signal.